package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.PesticideConsumeTemporaryMapper;
import com.ruoyi.consume.domain.PesticideConsumeTemporary;
import com.ruoyi.consume.service.IPesticideConsumeTemporaryService;

/**
 * 查看临时领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class PesticideConsumeTemporaryServiceImpl implements IPesticideConsumeTemporaryService
{
    @Autowired
    private PesticideConsumeTemporaryMapper pesticideConsumeTemporaryMapper;

    /**
     * 查询查看临时领用信息
     *
     * @param pesticideConsumeTemporaryId 查看临时领用信息ID
     * @return 查看临时领用信息
     */
    @Override
    public PesticideConsumeTemporary selectPesticideConsumeTemporaryById(Long pesticideConsumeTemporaryId)
    {
        return pesticideConsumeTemporaryMapper.selectPesticideConsumeTemporaryById(pesticideConsumeTemporaryId);
    }

    /**
     * 查询查看临时领用信息列表
     *
     * @param pesticideConsumeTemporary 查看临时领用信息
     * @return 查看临时领用信息
     */
    @Override
    public List<PesticideConsumeTemporary> selectPesticideConsumeTemporaryList(PesticideConsumeTemporary pesticideConsumeTemporary)
    {
        return pesticideConsumeTemporaryMapper.selectPesticideConsumeTemporaryList(pesticideConsumeTemporary);
    }

    /**
     * 新增查看临时领用信息
     *
     * @param pesticideConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int insertPesticideConsumeTemporary(PesticideConsumeTemporary pesticideConsumeTemporary)
    {
        pesticideConsumeTemporary.setCreateTime(DateUtils.getNowDate());
        return pesticideConsumeTemporaryMapper.insertPesticideConsumeTemporary(pesticideConsumeTemporary);
    }

    /**
     * 修改查看临时领用信息
     *
     * @param pesticideConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int updatePesticideConsumeTemporary(PesticideConsumeTemporary pesticideConsumeTemporary)
    {
        pesticideConsumeTemporary.setUpdateTime(DateUtils.getNowDate());
        return pesticideConsumeTemporaryMapper.updatePesticideConsumeTemporary(pesticideConsumeTemporary);
    }

    /**
     * 批量删除查看临时领用信息
     *
     * @param pesticideConsumeTemporaryIds 需要删除的查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deletePesticideConsumeTemporaryByIds(Long[] pesticideConsumeTemporaryIds)
    {
        return pesticideConsumeTemporaryMapper.deletePesticideConsumeTemporaryByIds(pesticideConsumeTemporaryIds);
    }

    /**
     * 删除查看临时领用信息信息
     *
     * @param pesticideConsumeTemporaryId 查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deletePesticideConsumeTemporaryById(Long pesticideConsumeTemporaryId)
    {
        return pesticideConsumeTemporaryMapper.deletePesticideConsumeTemporaryById(pesticideConsumeTemporaryId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<PesticideConsumeTemporary> getUserName(){
        return pesticideConsumeTemporaryMapper.getUserName();
    }
}
